/* AI模块公共样式 */
@import './theme.less';

/* 通用容器样式 */
.ai-container {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px;

  &.dark {
    color: @dark-text-color;
    background-color: @dark-bg-color;
  }

  &.light {
    color: @light-text-color;
    background-color: @light-bg-color;
  }
}

/* 顶部区域 */
.ai-header {
  margin-bottom: 20px;

  .title {
    margin-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
  }

  .description {
    font-size: 14px;
    color: #666;

    .dark & {
      color: #aaa;
    }
  }
}

/* 内容区域 */
.ai-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

/* 底部操作区域 */
.ai-footer {
  padding-top: 16px;
  margin-top: auto;
}

/* 按钮样式 */
.animated-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;

  &:hover {
    box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
    transform: translateY(-2px);
  }

  &:active {
    box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
    transform: translateY(0);
  }

  .dark & {
    box-shadow: 0 2px 5px rgb(0 0 0 / 30%);

    &:hover {
      box-shadow: 0 5px 15px rgb(0 0 0 / 40%);
    }
  }
}

/* 输入区域 */
.input-area {
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 8px;

  .dark & {
    background-color: @dark-secondary-bg;
  }

  .light & {
    background-color: @light-secondary-bg;
  }
}

/* 结果区域 */
.result-area {
  flex: 1;
  overflow: hidden;
  border-radius: 8px;

  .dark & {
    background-color: @dark-secondary-bg;
    border: 1px solid @dark-border-color;
  }

  .light & {
    background-color: @light-secondary-bg;
    border: 1px solid @light-border-color;
  }
}

/* 加载状态 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 200px;
}

/* 结果图像 */
.result-image {
  max-width: 100%;
  border-radius: 8px;
  transition: all 0.3s ease;

  &:hover {
    box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
    transform: scale(1.01);
  }
}

/* 响应式样式 */
@media (max-width: 768px) {
  .ai-container {
    padding: 15px;
  }

  .ai-header .title {
    font-size: 20px;
  }
}

@media (max-width: 576px) {
  .ai-container {
    padding: 10px;
  }

  .ai-header .title {
    font-size: 18px;
  }
}

/* AI功能页面通用样式 */

/* 卡片样式 */
.ai-card {
  margin-bottom: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 15%);
}

/* 加载动画 */
.ai-loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: var(--loading-bg, rgb(245 245 245 / 5%));
  border: 1px dashed var(--loading-border, rgb(0 0 0 / 20%));
  border-radius: 8px;
}

.loading-content {
  padding: 20px;
  text-align: center;

  .spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
  }

  .spinner-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--primary-color, #1890ff);
    border-right-color: var(--primary-color, #1890ff);
    border-radius: 50%;
    animation: spinner-rotate 1.5s linear infinite;
  }

  .spinner-circle-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color, #1890ff);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spinner-pulse 1.5s ease-in-out infinite;
  }

  .loading-text {
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--text-color, inherit);
  }

  .loading-subtext {
    font-size: 14px;
    color: var(--text-color-secondary, rgb(0 0 0 / 45%));
  }
}

@keyframes spinner-rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinner-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.8);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 渐入动画 */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 表单样式 */
.form-item {
  margin-bottom: 16px;

  .form-label {
    margin-bottom: 8px;
    font-weight: 500;
  }
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* 空状态样式 */
.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 32px;
  text-align: center;

  .empty-icon {
    margin-bottom: 16px;
    font-size: 48px;
    color: var(--icon-color, rgb(0 0 0 / 25%));
  }

  .empty-text {
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--text-color, rgb(0 0 0 / 85%));
  }

  .empty-tips {
    font-size: 14px;
    color: var(--text-color-secondary, rgb(0 0 0 / 45%));
  }
}

/* 响应式布局 */
.responsive-container {
  display: flex;
  flex-direction: row;
  gap: 24px;

  @media (max-width: 768px) {
    flex-direction: column;
  }

  .left-section {
    flex: 1;
    min-width: 300px;
  }

  .right-section {
    flex: 2;
  }
}
